﻿<Window x:Class="BandAid.Gui.WPFBandAid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:custom="clr-namespace:BandAid"
    Title="BandAid" Height="768" Width="1024" xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" Loaded="dataBind" Icon="/BandAid;component/Resources/appIcon.png" xmlns:igDP="http://infragistics.com/DataPresenter">
    <Window.Resources>
        <ObjectDataProvider x:Key="artists" ObjectType="{x:Type custom:Archives}" MethodName="GetArtistArchive"/>
        <ObjectDataProvider x:Key="songs" ObjectType="{x:Type custom:Archives}" MethodName="GetSongsArchive"/>
        <ObjectDataProvider x:Key="places" ObjectType="{x:Type custom:Archives}" MethodName="GetPlacesArchive"/>
        <ObjectDataProvider x:Key="shows" ObjectType="{x:Type custom:Archives}" MethodName="GetShowsArchive"/>
        <ObjectDataProvider x:Key="showSongs" ObjectType="{x:Type custom:Archives}" MethodName="GetShowSongsArchive"/>
        <ObjectDataProvider x:Key="newPlaylist" ObjectType="{x:Type custom:Archives}" MethodName="GetNewPlaylistArchive"/>

    </Window.Resources>
    <Border BorderThickness="1" BorderBrush="Gray">
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="350*" />
            <RowDefinition Height="792*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="266*" />
            <ColumnDefinition Width="105*" />
            <ColumnDefinition Width="170*" />
            <ColumnDefinition Width="195*" />
            <ColumnDefinition Width="266*" />
        </Grid.ColumnDefinitions>
        
        <DockPanel Grid.ColumnSpan="2">
                <Border BorderThickness="1">
                    <igDP:XamDataGrid Name="datagridArtist" DataSource="{Binding Source={StaticResource artists}}" AutoFit="True" Theme="Generic" IsSynchronizedWithCurrentItem="True" RecordUpdated="datagrid_RecordUpdated" RecordAdded="datagridArtist_RecordAdded" RecordActivated="datagridArtist_RecordActivated" RecordsDeleting="datagridArtist_RecordsDeleting"   >
                        <igDP:XamDataGrid.FieldSettings>
                            <igDP:FieldSettings AllowRecordFiltering="True"  AllowSummaries="true" SummaryUIType="MultiSelect"/>
                        </igDP:XamDataGrid.FieldSettings>
                        <igDP:XamDataGrid.FieldLayouts>
                            <igDP:FieldLayout Description="Standard">
                                <igDP:FieldLayout.Fields>
                                    <igDP:Field Name="NAME" Label="Name" />
                                    <igDP:Field Name="DEFAULT_SIAE_OWNER" Label="Siae" />
                                  
                                    
                                </igDP:FieldLayout.Fields>
                            </igDP:FieldLayout>
                        </igDP:XamDataGrid.FieldLayouts>

                        <igDP:XamDataGrid.FieldLayoutSettings>
                            <igDP:FieldLayoutSettings AllowAddNew="True" AllowDelete="True" AddNewRecordLocation="OnTopFixed" FilterRecordLocation="Default" AutoGenerateFields="False" HeaderPlacement="Default" HighlightPrimaryField="Default" HighlightAlternateRecords="True" FilterAction="Default" FilterClearButtonLocation="Default" />
                        </igDP:XamDataGrid.FieldLayoutSettings>
                    </igDP:XamDataGrid>
                </Border>
            </DockPanel>

        <DockPanel Grid.Column="2" Grid.ColumnSpan="2" >
                <Border BorderThickness="1" BorderBrush="Gray" >

                    <igDP:XamDataGrid  Name="datagridSongs" DataSource="{Binding Source={StaticResource songs}}" AutoFit="True" Theme="Generic" IsSynchronizedWithCurrentItem="True" RecordUpdated="datagrid_RecordUpdated" RecordAdded="datagridSongs_RecordAdded">

                        <igDP:XamDataGrid.FieldSettings>
                            <igDP:FieldSettings AllowRecordFiltering="True"  AllowSummaries="true" SummaryUIType="MultiSelect"/>
                        </igDP:XamDataGrid.FieldSettings>
                        <igDP:XamDataGrid.FieldLayouts>
                            <igDP:FieldLayout Description="Standard">
                                <igDP:FieldLayout.Fields>
                                    <igDP:Field Name="TITLE" Label="Title" />
                                    <igDP:Field Name="LENGTH" Label="Length" />
                                    <igDP:Field Name="ID" Visibility="Collapsed"/>
                                    <igDP:Field Name="ARTIST_ID" Visibility="Collapsed"/>
                                    <igDP:Field Name="VIDEO_ID" Visibility="Collapsed"/>
                                </igDP:FieldLayout.Fields>
                            </igDP:FieldLayout>
                        </igDP:XamDataGrid.FieldLayouts>

                        <igDP:XamDataGrid.FieldLayoutSettings>
                            <igDP:FieldLayoutSettings AllowAddNew="True" AllowDelete="True" AddNewRecordLocation="OnTopFixed" FilterRecordLocation="Default" AutoGenerateFields="False" HeaderPlacement="Default" HighlightPrimaryField="Default" HighlightAlternateRecords="True" FilterAction="Default" FilterClearButtonLocation="Default" />
                        </igDP:XamDataGrid.FieldLayoutSettings>
                    </igDP:XamDataGrid>

                </Border>
            </DockPanel>
        
        <DockPanel Grid.Column="5" Grid.Row="0" Grid.RowSpan="2">
         
            
            <Border BorderThickness="1" BorderBrush="Gray" >
     
                <Grid>
            
            <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="20" />
                            <RowDefinition Height="65" />
        

            </Grid.RowDefinitions>
                    

            <igDP:XamDataGrid Grid.Row="0" AllowDrop="True" Name="datagridNewPlaylist" DataSource="{Binding Source={StaticResource newPlaylist}}" AutoFit="True" Theme="Generic" IsSynchronizedWithCurrentItem="True" RecordUpdated="datagrid_RecordUpdated" >
                <igDP:XamDataGrid.FieldSettings>
                        <igDP:FieldSettings AllowRecordFiltering="True" AllowEdit="False"  AllowSummaries="true" SummaryUIType="MultiSelect"/>
                    </igDP:XamDataGrid.FieldSettings>

                    <igDP:XamDataGrid.FieldLayouts>
                        <igDP:FieldLayout Description="Standard">
                            <igDP:FieldLayout.Fields>
                                        <igDP:Field Name="NUMBER" Label="#" />
                                        <igDP:Field Name="SongName" Label="Performed Song" />
                                        <igDP:Field Name="SongLength" Label="Length"/>


                                    </igDP:FieldLayout.Fields>
                        </igDP:FieldLayout>
                    </igDP:XamDataGrid.FieldLayouts>

                    <igDP:XamDataGrid.FieldLayoutSettings>
                        <igDP:FieldLayoutSettings AllowDelete="True" AddNewRecordLocation="OnTopFixed" FilterRecordLocation="Default" AutoGenerateFields="False" HeaderPlacement="Default" HighlightPrimaryField="Default" HighlightAlternateRecords="True" FilterAction="Default" FilterClearButtonLocation="Default" />
                    </igDP:XamDataGrid.FieldLayoutSettings>
                </igDP:XamDataGrid>

                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" Click="Clone_Current_Show">Copy from current show</Button>
                    <Button Grid.Column="1" Click="Add_Current_Song">Add from current song</Button>
                </Grid>

                <StackPanel Grid.Row="2">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Place: " />
                        <ComboBox Name="newShowPlace" Grid.Column="1"  ItemsSource="{Binding Source={StaticResource places}}"></ComboBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="Date: " />
                        <TextBox Name="newShowDate" Grid.Column="1"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Click="Playlist_Discard">Discard</Button>
                        <Button Grid.Column="1" Click="Save_Playlist_To_Show">Save</Button>
                    </Grid>
                </StackPanel>
            </Grid>
            </Border>
</DockPanel>


            <DockPanel Grid.Row="1" Grid.Column="0" >
                <Border BorderThickness="1" BorderBrush="Gray" >
                    <igDP:XamDataGrid Name="datagridPlaces" DataSource="{Binding Source={StaticResource places}}" AutoFit="True" Theme="Generic" IsSynchronizedWithCurrentItem="True" RecordUpdated="datagrid_RecordUpdated" RecordAdded="datagridPlaces_RecordAdded" RecordActivated="datagridPlaces_RecordActivated">
                        <igDP:XamDataGrid.FieldSettings>
                            <igDP:FieldSettings AllowRecordFiltering="True"  AllowSummaries="true" SummaryUIType="MultiSelect"/>
                        </igDP:XamDataGrid.FieldSettings>
                        <igDP:XamDataGrid.FieldLayouts>
                            <igDP:FieldLayout Description="Standard">
                                <igDP:FieldLayout.Fields>
                                    <igDP:Field Name="NAME" Label="Name" />
                                    <igDP:Field Name="OWNER_NAME" Label="Owner" />
                                    <igDP:Field Name="ID" Visibility="Collapsed"/>
                                    <igDP:Field Name="ADDRESS" Label="Address"/>
                                    <igDP:Field Name="CONTACT" Label="Contact"/>
                                </igDP:FieldLayout.Fields>
                            </igDP:FieldLayout>
                        </igDP:XamDataGrid.FieldLayouts>

                        <igDP:XamDataGrid.FieldLayoutSettings>
                            <igDP:FieldLayoutSettings AllowAddNew="True" AllowDelete="True" AddNewRecordLocation="OnTopFixed" FilterRecordLocation="Default" AutoGenerateFields="False" HeaderPlacement="Default" HighlightPrimaryField="Default" HighlightAlternateRecords="True" FilterAction="Default" FilterClearButtonLocation="Default" />
                        </igDP:XamDataGrid.FieldLayoutSettings>
                    </igDP:XamDataGrid>
                </Border>
            </DockPanel>

        <DockPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" >
                <Border BorderThickness="1" BorderBrush="Gray" >
                    <igDP:XamDataGrid Name="datagridShows" DataSource="{Binding Source={StaticResource shows}}" AutoFit="True" Theme="Generic" IsSynchronizedWithCurrentItem="True" RecordUpdated="datagrid_RecordUpdated" RecordAdded="datagridShows_RecordAdded" RecordActivated="datagridShows_RecordActivated" >
                        <igDP:XamDataGrid.FieldSettings>
                            <igDP:FieldSettings AllowRecordFiltering="True"  AllowSummaries="true" SummaryUIType="MultiSelect"/>
                        </igDP:XamDataGrid.FieldSettings>

                        <igDP:XamDataGrid.FieldLayouts>
                            <igDP:FieldLayout Description="Standard">
                                <igDP:FieldLayout.Fields>
                                    <igDP:Field Name="DATE" Label="Date" />
                                    <igDP:Field Name="CACHET" Label="Cachet" />
                                    <igDP:Field Name="ID" Visibility="Collapsed"/>
                                    <igDP:Field Name="INVITED_NO" Label="Invited"/>
                                    <igDP:Field Name="ATTENDEES_NO" Label="Attendees"/>
                                    <igDP:Field Name="PLACE_ID" Visibility="Collapsed"/>
                                </igDP:FieldLayout.Fields>
                            </igDP:FieldLayout>
                        </igDP:XamDataGrid.FieldLayouts>

                        <igDP:XamDataGrid.FieldLayoutSettings>
                            <igDP:FieldLayoutSettings AllowAddNew="True" AllowDelete="True" AddNewRecordLocation="OnTopFixed" FilterRecordLocation="Default" AutoGenerateFields="False" HeaderPlacement="Default" HighlightPrimaryField="Default" HighlightAlternateRecords="True" FilterAction="Default" FilterClearButtonLocation="Default" />
                        </igDP:XamDataGrid.FieldLayoutSettings>
                    </igDP:XamDataGrid>
                </Border>
            </DockPanel>
        
        <DockPanel Grid.Column="3" Grid.Row="1"  >
                <Border BorderThickness="1" BorderBrush="Gray" >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"></RowDefinition>
                            <RowDefinition Height="20" />
                        </Grid.RowDefinitions>
                        <igDP:XamDataGrid Name="datagridShowSongs" DataSource="{Binding Source={StaticResource showSongs}}" AutoFit="True" Theme="Generic" IsSynchronizedWithCurrentItem="True" RecordUpdated="datagrid_RecordUpdated" >
                            <igDP:XamDataGrid.FieldSettings>
                                <igDP:FieldSettings  AllowEdit="False" AllowRecordFiltering="True"  AllowSummaries="true" SummaryUIType="MultiSelect"/>
                            </igDP:XamDataGrid.FieldSettings>

                            <igDP:XamDataGrid.FieldLayouts>
                                <igDP:FieldLayout Description="Standard">
                                    <igDP:FieldLayout.Fields>
                                        <igDP:Field Name="NUMBER" Label="#" />
                                        <igDP:Field Name="SongName" Label="Performed Song" />
                                        <igDP:Field Name="SongLength" Label="Length"/>
                                      
                                    </igDP:FieldLayout.Fields>
                                </igDP:FieldLayout>
                            </igDP:XamDataGrid.FieldLayouts>

                            <igDP:XamDataGrid.FieldLayoutSettings>
                                <igDP:FieldLayoutSettings AllowAddNew="True" AllowDelete="True" AddNewRecordLocation="OnTopFixed" FilterRecordLocation="Default" AutoGenerateFields="False" HeaderPlacement="Default" HighlightPrimaryField="Default" HighlightAlternateRecords="True" FilterAction="Default" FilterClearButtonLocation="Default" />
                            </igDP:XamDataGrid.FieldLayoutSettings>
                        </igDP:XamDataGrid>
                        <Button Height="20" Grid.Row="1" Click="Button_Click">Add current song to show</Button>
                    </Grid>
                </Border>
            </DockPanel>
    </Grid>     
    </Border>
</Window>
